package login

import (
	"beego-demo/controllers/base"
	"fmt"
)

type RestController struct {
	base.Controller
}

func (c *RestController) ListFood() {
	fmt.Println("GET请求执行此函数")
	c.Ctx.WriteString("Hello GET")
}

func (c *RestController) CreateFood() {
	fmt.Println("POST请求执行此函数")
	c.Ctx.WriteString("Hello POST")
}

func (c *RestController) UpdateFood() {
	fmt.Println("PUT请求执行此函数")
	c.Ctx.WriteString("Hello PUT")
}

func (c *RestController) DeleteFood() {
	fmt.Println("DELETE请求执行此函数")
	c.Ctx.WriteString("Hello DELETE")
}

func (c *RestController) ApiFunc() {
	fmt.Println("/api/multi GET、POST都对应此函数")
	c.SuccessJson("/api/multi GET、POST都对应此函数")
}
